function bind(obj) obj:bind_object(camp_binder( obj )) end -- Таблица, содержащая кемпы camps = {} ---------------------------------------------------------------------------------------------------- class "camp_binder" ( object_binder ) function camp_binder:__init(obj, char_ini) super(obj) end function camp_binder:reload(section) object_binder.reload(self, section) end function camp_binder:reinit() object_binder.reinit(self) end function camp_binder:net_spawn(se_abstract) if not object_binder.net_spawn(self, se_abstract) then return false end --[[ No reason for this because all camp use scripts\\camp.ltx local spawn_ini = self.object:spawn_ini() local filename = spawn_ini and spawn_ini:r_string_ex("camp","cfg") or "scripts\\camp.ltx" if (filename) then local ini = ini_file(filename) if not (ini) then printf("WARNING: camp_binder:net_spawn %s no 'camp' section in spawn ini!",self.object:name()) return true end camps[self.object:id()] = { object = self.object, camp = sr_camp.CCampManager(self.object, ini) } end --]] camps[self.object:id()] = { object = self.object, camp = sr_camp.CCampManager(self.object) } return true end function camp_binder:net_destroy() camps[self.object:id()] = nil object_binder.net_destroy(self) end -- вызывается из обновления актёра! function camp_binder:update(delta) local cc = camps[self.object:id()] if cc ~= nil then cc.camp:update() end end function camp_binder:net_save_relevant() return true end function camp_binder:save(packet) set_save_marker(packet, "save", false, "camp_binder") object_binder.save(self, packet) set_save_marker(packet, "save", true, "camp_binder") end function camp_binder:load(reader) set_save_marker(reader, "load", false, "camp_binder") object_binder.load(self, reader) set_save_marker(reader, "load", true, "camp_binder") end